<?php

namespace CMBUBank\UBank\Info\TransManager;

class Payee
{

    /**
     * 金额
     * @var string  $amount
     */
    private $amount;

    /**
     * 系统内标志
     * @var string $bankFlg
     */
    private $bankFlg = 'Y';

    /**
     * 收方分行号
     * @var string $bankNo
     */
    private $bankNo;

    /**
     * 收方开户行行号
     * @var string $bankNoName
     */
    private $bankNoName;

    /**
     * 收方帐号
     * @var string $account
     */
    private $account;

    /**
     * 收方户名
     * @var string $name
     */
    private $name;

    /**
     * 收方行名称
     * @var string $backName
     */
    private $backName;

    /**
     * 收方行地址
     * @var string $address
     */
    private $address;

    /**
     * 期望日
     * @var string $data
     */
    private $expectData;

    /**
     * 期望时间
     * @var string $expectTime
     */
    private $expectTime;

    /**
     * 结算通道
     * @var string $channel
     */
    private $channel = 'F';

    /**
     * 用途
     * @var string $remark
     */
    private $remark;

    /**
     * 业务种类
     * @var string $type
     */
    private $type = '100001';

    /**
     * 退款参数 - 原交易套号
     * @var string $setNo
     */
    private $setNo;

    /**
     * 退款参数 - 原交易流水号
     * @var string $tradeNo
     */
    private $tradeNo;

    /**
     * 打款参数
     * @return array
     */
    public function generate(): array
    {
        return [
            'trsamt' => $this->amount,
            'bnkflg' => $this->bankFlg,
            'oppbbk' => $this->bankNo,
            'oppbbn' => $this->bankNoName,
            'crtacc' => $this->account,
            'crtnam' => $this->name,
            'crtbnk' => $this->backName,
            'crtadr' => $this->address,
            'eptdat' => $this->expectData,
            'epttim' => $this->expectTime,
            'stlchn' => $this->channel,
            'nusage' => $this->remark,
            'busnar' => $this->remark,
            'trstyp' => $this->type,
        ];
    }

    /**
     * 退款参数1
     * @return string[]
     */
    public function refund():array
    {
        return [
            'setnbr' => $this->setNo,
            'trxnbr' => $this->tradeNo,
            'trsamt' => $this->amount,
            'rpyacc' => $this->account,
            'rpynam' => $this->name,
            'busnar' => $this->remark,
        ];
    }

    public function refund2() :array
    {
        return [
            'rpyadr' => $this->address
        ];
    }

    /**
     * @param string $amount
     */
    public function setAmount(string $amount): void
    {
        $this->amount = $amount;
    }

    /**
     * @param string $bankFlg
     */
    public function setBankFlg(string $bankFlg): void
    {
        $this->bankFlg = $bankFlg;
    }

    /**
     * @param string $bankNo
     */
    public function setBankNo(string $bankNo): void
    {
        $this->bankNo = $bankNo;
    }

    /**
     * @param string $bankNoName
     */
    public function setBankNoName(string $bankNoName): void
    {
        $this->bankNoName = $bankNoName;
    }

    /**
     * @param string $account
     */
    public function setAccount(string $account): void
    {
        $this->account = $account;
    }

    /**
     * @param string $name
     */
    public function setName(string $name): void
    {
        $this->name = $name;
    }

    /**
     * @param string $backName
     */
    public function setBackName(string $backName): void
    {
        $this->backName = $backName;
    }

    /**
     * @param string $address
     */
    public function setAddress(string $address): void
    {
        $this->address = $address;
    }

    /**
     * @param string $expectData
     */
    public function setExpectData(string $expectData): void
    {
        $this->expectData = $expectData;
    }

    /**
     * @param string $expectTime
     */
    public function setExpectTime(string $expectTime): void
    {
        $this->expectTime = $expectTime;
    }

    /**
     * @param string $channel
     */
    public function setChannel(string $channel): void
    {
        $this->channel = $channel;
    }

    /**
     * @param string $remark
     */
    public function setRemark(string $remark): void
    {
        $this->remark = $remark;
    }

    /**
     * @param string $type
     */
    public function setType(string $type): void
    {
        $this->type = $type;
    }

    /**
     * @param string $setNo
     */
    public function setSetNo(string $setNo): void
    {
        $this->setNo = $setNo;
    }

    /**
     * @param string $tradeNo
     */
    public function setTradeNo(string $tradeNo): void
    {
        $this->tradeNo = $tradeNo;
    }


}